package com.zhxymm.book.service;

import com.zhxymm.book.dao.OverTimeRepository;
import com.zhxymm.book.entity.OverTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OverTimeService {

    @Autowired
    OverTimeRepository overTimeRepository;

    public OverTime save(OverTime overTime){
        return overTimeRepository.save(overTime);
    }

    public List<OverTime> getAll(){
        return overTimeRepository.findAll();
    }

    public  OverTime findByOverTimeId(long theId){
        return overTimeRepository.findByOverTimeId(theId);
    }

    public void delete(OverTime theOverTime) {

        overTimeRepository.delete(theOverTime);
    }
}
